#include "cpu/exec/helper.h"

#define DATA_BYTE 1
#include "js-template.h"
#undef DATA_BYTE

#define DATA_BYTE 4
#include "js-template.h"
#undef DATA_BYTE

make_helper(js_si_w){
    int len = decode_i_w(eip + 1);
    op_src->val = (int32_t)(int16_t)op_src->val;
    if(cpu.eflags.SF == 1){
        cpu.eip += op_src->val;
        cpu.eip = cpu.eip & 0x0000FFFF;
    }
    snprintf(op_src->str, OP_STR_SIZE, "$0x%x", op_src->val);
    print_asm(str(js) str(w) " %s", op_src->str);
    return len + 1;
}

make_helper_v(js_si)